Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@nightingale-elements/nightingale-track
Advanced tools
The nightingale-track
component is used to display protein features. These features have start
and end
positions (these can be the same if the feature only spans one amino-acid), a specific shape (rectangle is the default) and a color. Features are passed through the data
property. You can specify shapes and colors at an instance level (through a property) or individually in the feature data
(see data
below). In order to establish the scale, it is necessary to set the length
property (length of the protein sequence in amino-acids).
As nightingale-track
implements from withZoom
and withHighlight
, it will respond to zooming changes, highlight events and emit events when interacting with features (helpful if you want to display tooltips).
Loading data can be done directly through the data
property.
There are two types of display available for nightingale-track
:
<nightingale-track
id="my-track-id"
length="223"
height="100"
display-start="1"
display-end="50"
layout="non-overlapping"
></nightingale-track>
const track = document.querySelector("#my-track-id");
track.data = myDataObject;
color?: string | null (default: "gray")
Color of all features within the track. This could be overwriten if the feature in the data specifies its color.
shape?: string | null (default: "rectangle")
Shape of all features within the track. This could be overwriten if the feature in the data specifies its shape.
layout?: "non-overlapping" | "default" (default: "default")
The track layout. Non-overlapping uses a bumping algorhithm to make sure none of the features overlapp.
data: Array
Array of items of type Feature
as shown below:
type FeatureLocation = {
fragments: Array<{
start: number,
end: number,
}>,
};
type Feature = {
accession: string,
color?: string,
fill?: string,
shape?:
| "rectangle"
| "bridge"
| "diamond"
| "chevron"
| "catFace"
| "triangle"
| "wave"
| "hexagon"
| "pentagon"
| "circle"
| "arrow"
| "doubleBar",
tooltipContent?: string,
type?: string,
locations?: Array<FeatureLocation>,
feature?: Feature,
start?: number,
end?: number,
opacity?: number,
};
Note: locations
is an alternative to start
-stop
attributes, that expresses that a feature can appear in several locations, and also supports the idea of discontinuous features, by allowing to have fragments
.
So for example a single continuous feature, that only appears once can be represented in 2 ways. The classic {accession:'X', start:2, end:4}
or a more verbose version: {accession:'X', locations: [{fragments: [{start:2, end:4}]}]}
an both should generate a track like this:
-XXX------
If the same feature appears in 2 places in the sequence, it can be represented using locations
:
{
accession: 'Y',
locations: [
{fragments: [{start:2, end:4}]},
{fragments: [{start:7, end:9}]}
]
}
To generate a track like
-YYY--YYY-
Finally a feature can also be discontinuous, to repesent this in our data we use fragments
:
{
accession: 'Z',
locations: [
{fragments: [
{start:2, end:4},
{start:7, end:9}]
}
]
}
This expresses that the same instance of the feature Z is split in 2 fragments, from 2 to 4 and from 7 to 9. Which could be represented as
-ZZZ==ZZZ-
This component inherits from NightingaleElement
.
The component implements the following mixins: withManager
, withResizable
, withMargin
, withPosition
, withDimensions
, withHighlight
FAQs
Basic track type of the viewer.
The npm package @nightingale-elements/nightingale-track receives a total of 174 weekly downloads. As such, @nightingale-elements/nightingale-track popularity was classified as not popular.
We found that @nightingale-elements/nightingale-track demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.